<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<title>ShowHelp</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>

<body>

<h1>ShowHelp</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="index.html">service functions</a><br>
</div>

<div class=shortdescr>
The <dfn>ShowHelp</dfn> function shows the specified topic from a given hlf-file.
</div>

<pre class=syntax>
BOOL WINAPI ShowHelp(
  const char *ModuleName,
  const char *HelpTopic,
  int   Flags
);
</pre>

<h3>Parameters</h3>
<div class=descr>
  <div class=dfn>ModuleName</div>
  <div class=dfndescr>Name of the plugin module. It is passed to the plugin in the
    <a href="../exported_functions/setstartupinfo.html">SetStartupInfo</a> function.</div>
  <div class=dfn>HelpTopic</div>
  <div class=dfndescr><a href="../language/helptopic.html">Help topic</a>.
    If this parameter is <code>NULL</code>, then the topic
    "<a href="../language/help_files.html">Contents</a>" will be used.
  </div>
  <div class=dfn>Flags</div>
    <div class=dfndescr>Can be one of the following values (<a name="FarHelpFlags">FarHelpFlags</a> enum):
   <table class="cont"><tr class="cont"><th class="cont" width="40%">Constant</th><th class="cont" width="60%">Description</th></tr>
    <tr class="cont"><td class="cont" width="40%"><a name="FHELP_SELFHELP">FHELP_SELFHELP</a></td>
    <td class="cont" width="60%">Assume <var>ModuleName</var> is <kbd>Info.ModuleName</kbd> and
      show the topic from the help file of the calling plugin. If <var>HelpTopic</var> begins with
      a coulomb <code>':'</code>, the topic from the main FAR help file will be shown (in that case
    <var>ModuleName</var> is ignored).</td></tr>
    <tr class="cont"><td class="cont" width="40%"><a name="FHELP_FARHELP">FHELP_FARHELP</a></td>
    <td class="cont" width="60%"><var>ModuleName</var> is ignored and the topic from the main FAR
      help file will be shown. In this case you do not need to start the <var>HelpTopic</var> with a
      coulomb <code>':'</code>.</td></tr>
    <tr class="cont"><td class="cont" width="40%"><a name="FHELP_CUSTOMFILE">FHELP_CUSTOMFILE</a></td>
    <td class="cont" width="60%">Assume <var>ModuleName</var> specifies full path to a hlf-file (<code>c:\path\filename</code>).</td></tr>
    <tr class="cont"><td class="cont" width="40%"><a name="FHELP_CUSTOMPATH">FHELP_CUSTOMPATH</a></td>
    <td class="cont" width="60%">Assume <var>ModuleName</var> specifies full path to a folder
      (<code>c:\path</code>) from which a help file will be selected according to current language
      settings.</td></tr>
    <tr class="cont"><td class="cont" width="40%"><a name="FHELP_USECONTENTS">FHELP_USECONTENTS</a></td>
    <td class="cont" width="60%">If the specified <var>HelpTopic</var> is not found, will try to
      show the <code>"Contents"</code> topic. This flag can be combined with other flags.</td></tr>
    <tr class="cont"><td class="cont" width="40%"><a name="FHELP_NOSHOWERROR">FHELP_NOSHOWERROR</a></td>
    <td class="cont" width="60%">Disable file or topic not found error messages for this function call.
       This flag can be combined with other flags.</td></tr>
   </table>
  </div>
</div>

<h3>Return value</h3>
<div class=descr>
<code>TRUE</code> - parameters were successfully transferred to the Help Manager.<br>
<code>FALSE</code> - one of the following errors occurred:
<ul>
<li><var>Flags</var> contains an illegal value.
<li><var>ModuleName</var> = <code>NULL</code> and <dfn>FHELP_FARHELP</dfn> flag is not set.
<li>Specified help file or topic were not found by the Help Manager.
<li>Help file or topic were not found while browsing the help file.
</ul>
</div>

<h3>Example</h3>
<div class=descr>
  For convience when frequently used the following function can be used in your plugin:
<pre class=code>void ShowHelp(const char *HelpTopic)
{
  Info.ShowHelp(Info.ModuleName,HelpTopic,0);
}
</pre>

<dfn>Info</dfn> is defined as a global variable...

<pre class=code>struct PluginStartupInfo <dfn>Info</dfn>;</pre>

  ...ans is initialized in the
  <a href="../exported_functions/setstartupinfo.html">SetStartupInfo</a> function:

<pre class=code>void WINAPI _export SetStartupInfo(const struct PluginStartupInfo *Info)
{
. . .
  ::<dfn>Info</dfn>=*Info;
. . .
}</pre>

</div>

<div class=see>See also:</div><div class=seecont>
<a href="../language/help_files.html">Help files</a>
</div>

</body>
</html>